﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QuanLyDoanVien.DataLayer;
using QuanLyDoanVien.Bussiness;
using DevComponents.DotNetBar.Controls;
using System.Windows.Forms;

namespace QuanLyDoanVien.Controller
{
    class KyLuatCtrl
    {
        KyLuatData m_KyLuatData = new KyLuatData();
        public List<KyLuatInfo> layDSKyLuat()
        {
            return m_KyLuatData.layDSKyLuat();
        }
        public void HienThiComboBox(ComboBoxEx cbx)
        {
            cbx.DataSource = m_KyLuatData.layDSKyLuat();
            cbx.DisplayMember = "TenKyLuat";
            cbx.ValueMember = "MaKyLuat";
        }

        public void HienThiListBox(ListBox lst)
        {
            lst.DataSource = m_KyLuatData.layDSKyLuat();
            lst.DisplayMember = "TenKyLuat";
            lst.ValueMember = "MaKyLuat";
        }
#region Them
        public void ThemKyLuat(KyLuatInfo kl)
        {
            m_KyLuatData.ThemKyLuat(kl);
        }
#endregion
        #region Xoa
        public bool XoaKyLuat(String makyluat)
        {
           return m_KyLuatData.XoaKyLuat(makyluat);
        }
        #endregion
        #region Sua
        public bool SuaKyLuat(KyLuatInfo kl)
        {
            return m_KyLuatData.SuaKyLuat(kl);
        }
        #endregion

        public string getAutoID()
        {
            return m_KyLuatData.getAutoID();
        }
    }
}
